package com.dji.ux.sample.MediaManager;

import java.io.FileOutputStream;
import Decoder.BASE64Decoder;
import Decoder.BASE64Encoder;

public class DecodeBase64IMG {

    /**
     * tran base64Code String to JPG
     * @param base64Code
     * @param savePath
     * @throws Exception
     */
    public static void decoderBase64File(String base64Code,String savePath) throws Exception {
        byte[] buffer = new BASE64Decoder().decodeBuffer(base64Code);
        FileOutputStream out = new FileOutputStream(savePath);
        out.write(buffer);
        out.close();
    }

}
